package com.wwwc.index.web.ejb.database;

import java.rmi.RemoteException;
import java.util.*;

public interface EJBDatabaseQuery extends javax.ejb.EJBObject {
    public ArrayList select(String query) throws RemoteException;
    public ArrayList selectSingleRecord(String query) throws RemoteException;
    public ArrayList selectSingleForumRecord(String query) throws RemoteException;
    //==============================================================================
    // Schedule-D
    //===============================================================================
    public ArrayList selectUserScheduleDInfo(String user_name) throws RemoteException;
    public ArrayList selectUserScheduleDInfo(String user_name, String bid) throws RemoteException;
    public ArrayList selectUserScheduleDInfo(String user_name, String bid, String year) throws RemoteException;
    public ArrayList selectUserScheduleDInfo(String user_name, String bid, String year, int before_or_after) throws RemoteException;
    public ArrayList getScheduleDInfo(String user_name, String year, String status) throws RemoteException;

    public ArrayList selectUserScheduleDRecords(String user_name) throws RemoteException;
    public ArrayList selectUserScheduleDRecords(String user_name, String broker_id, String year) throws RemoteException;
    public Vector selectSingleFieldScheduleDData(int id, String user, String field) throws RemoteException;

 
    public Object selectScheduleDTicks(String fid, int type) throws RemoteException;
    public int updateScheduleDTick(String fid, String otick, String ntick) throws RemoteException;

    public int insertTaxScheduleD(String user, String broker_id, String t_sold, String year, Vector vv) throws RemoteException;
    public int updateUserScheduleDStatus(String user, String year, String broker_id, int status) throws RemoteException;
    public int updateUserScheduleDStatus(String user, String broker_id, int status) throws RemoteException;
    public int insertScheduleDDetailRecords(int fid, String user, int year, int bid, int stid, Vector vv) throws RemoteException;
    public boolean updateScheduleD1099PreHolding(String user, String fid, Vector vv) throws RemoteException;

    public Vector selectScheduleDDetailRecords(String fid, String status, int order) throws RemoteException;
    public Vector selectScheduleDDetailRecordVector(String fid, int order) throws RemoteException;
    public Vector selectScheduleDDetailRecordVector(String fid, int order, String tick, String bs) throws RemoteException;
    public Vector selectScheduleDDetailRecords(String fid, String status, int order, String tick) throws RemoteException;
    public Vector getLastYearDetailHoldingRecords(String user_name, String year, String bid) throws RemoteException;
    public Vector getLastYearDetailHoldingRecordVector(String user_name, String year, String bid) throws RemoteException;

    public Vector getBoughtOrSoldDetailRecords(String fid, String tick, int bs) throws RemoteException;
    public int findBaseYear (String user_name, String broker_id, String year) throws RemoteException;

    public int scheduleDGetUmatchedShares(String fid, String user, String year, String broker_id, String tick) throws RemoteException;
    public boolean deleteThisYearHoldingRecords(String fid, String user, String year, String broker_id) throws RemoteException;
    public boolean saveThisYearHoldingRecords(String fid, String user, String year, String broker_id, Vector vr) throws RemoteException;
    public Vector selectHoldingRecords(String fid, String user, String year, String broker_id) throws RemoteException;
    public boolean saveFinalRecords(String fid, String user, String year, String bid, Vector vv) throws RemoteException;
    public Vector getFinalRecords(String fid, String user, String year, String bid) throws RemoteException;
    public ArrayList getScheduleDUsers() throws RemoteException;
    public String  getScheduleDFinalGain(String fid, String user) throws RemoteException;
    //public String  getScheduleDFinalGain(String fid, String user) throws RemoteException;


    public Hashtable selectSingleRecordHashtable(String query) throws RemoteException;
    public int delete(String query) throws RemoteException;
    public int insert(String query) throws RemoteException;
    public int insert(String query, Vector v) throws RemoteException;
    public int insertObject(String query, Object o) throws RemoteException;

    public int update(String query) throws RemoteException;
    public String selectSingleFieldValue(String query, String field) throws RemoteException;
    public Vector selectSingleFieldValueVector(String query, String field) throws RemoteException;

    public Object selectSingleFieldObject(String query, String field) throws RemoteException;

    public Hashtable selectTwoFieldValueHashtable(String query, String field1, String field2) throws RemoteException;
    public Vector selectColumnNames(String table_name) throws RemoteException;
    public Vector selectColumnTypes(String table_name) throws RemoteException;
    public Vector selectColumnSize(String table_name) throws RemoteException;
    public int insertByteArray(String query, byte[] bs) throws RemoteException;
    public byte[] selectByteArray(String query, String field) throws RemoteException;
    public byte[] selectByteArray(String query, int fid) throws RemoteException;
    public int getRowCounter(String table_name) throws RemoteException;
    public int getForumRowCounter(String table_name) throws RemoteException;
    public boolean userNameInUse(String user_name) throws RemoteException;

    public boolean addNewHotDeal(Vector vr) throws RemoteException;
    public ArrayList selectHotDeal(String fid) throws RemoteException;
    public boolean updateHotDeal(Vector vr) throws RemoteException;
}
